[wasm2c] Add the very beginning of a wasm2c implementation and test harness#8763
[wasm2c] Add the very beginning of a wasm2c implementation and test harness#8763lexi-nadia wants to merge 8 commits into
Conversation
These files are unmodified. Any necessary modifications will be included in follow-up commits.
There was a problem hiding this comment.
Please use .cpp instead of .cc as the extension for C++ sources.
| // | ||
| // Result: | ||
| // A pointer for an object of size n. | ||
| #if WABT_BIG_ENDIAN |
There was a problem hiding this comment.
Probably want to change uses of WABT to WASM2C or something like that.
| // We can only use Segue for this module if it uses a single unshared imported | ||
| // or exported memory | ||
| #if WASM_RT_USE_SEGUE && IS_SINGLE_UNSHARED_MEMORY |
There was a problem hiding this comment.
What will the testing story look like for all these different build configurations? I don't know what SEGUE is or who might be depending on it or how we're going to keep from breaking them.
There was a problem hiding this comment.
Can we create a src/tools/wasm2c directory and move the prebuilt/ and templates/ there, along with all of this wasm2c-specific CMake stuff?
| #include "support/file.h" | ||
|
|
||
| using namespace wasm; | ||
| using namespace wasm::WATParser; |
There was a problem hiding this comment.
Usually we only have using namespace wasm; and use its child namespaces as part of the names in the code. So it would be WATParser::parseScript below.
There was a problem hiding this comment.
Where are these text files used from? I didn't see anything in test/wasm2c.py, but maybe I missed it. It looks like they are similar to lit tests?
There was a problem hiding this comment.
What is this used for? Is it just a benchmark?
There was a problem hiding this comment.
How important is it to check in benchmarks? Is this something that can be added as a git submodule?
There was a problem hiding this comment.
It would be nice to avoid checking in this binary if we can avoid it.
There was a problem hiding this comment.
It would be nice to avoid adding a top-level wasm2c directory as well. Maybe this can move to tools/wasm2c along with the source.
This change adds an extremely bare-bones wasm2c implementation and test harness.
Most of the code here is imported directly from WABT, particularly the boilerplate code and tests. The only substantive new code is in src/wasm2c.h, src/tools/wasm2c.cpp, and scripts/test/wasm2c.py.
I tried to prune this down to be as minimal as possible while still providing a useful checkpoint, but I'm not sure I succeeded. Please feel free to offer suggestions if you see more ways to shrink this down.